<!DOCTYPE html>
<html lang="en-US" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>vitepress一键搭建github、gitee和个人网站博客 |   👉Aresnine 👈</title>
    <meta name="description" content="Aresnine的个人博客,web,vue,组件库,js">
    <link rel="preload stylesheet" href="/assets/style.427ea497.css" as="style">
    <link rel="modulepreload" href="/assets/app.db42a1fc.js">
    <link rel="modulepreload" href="/assets/technology_blog_index.md.b9d66824.lean.js">
    
    <script id="check-dark-light">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-236bb526><!--[--><!--]--><!--[--><span tabindex="-1" data-v-14c16caa></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-14c16caa> Skip to content </a><!--]--><!----><header class="VPNav" data-v-236bb526 data-v-de4e1621><div class="VPNavBar" data-v-de4e1621 data-v-52cf45e4><div class="container" data-v-52cf45e4><div class="title" data-v-52cf45e4><div class="VPNavBarTitle" data-v-52cf45e4 data-v-a8248850><a class="title" href="/" data-v-a8248850><!--[--><!--]--><!----><!--[-->  👉Aresnine 👈<!--]--><!--[--><!--]--></a></div></div><div class="content" data-v-52cf45e4><div class="curtain" data-v-52cf45e4></div><div class="content-body" data-v-52cf45e4><!--[--><!--]--><!----><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-52cf45e4 data-v-97cd7ece><span id="main-nav-aria-label" class="visually-hidden" data-v-97cd7ece>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/面试题/" data-v-97cd7ece data-v-502d9526 data-v-a6710068><!--[-->面试题<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/vitepress/" data-v-97cd7ece data-v-502d9526 data-v-a6710068><!--[-->vitePress<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/www/" data-v-97cd7ece data-v-502d9526 data-v-a6710068><!--[-->网站搭建<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/vue3/" data-v-97cd7ece data-v-502d9526 data-v-a6710068><!--[-->vue🐴<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/每日任务/" data-v-97cd7ece data-v-502d9526 data-v-a6710068><!--[-->每日任务<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/技术总结/" data-v-97cd7ece data-v-502d9526 data-v-a6710068><!--[-->技术总结<!--]--><!----></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-97cd7ece data-v-6d0cfa0d><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-6d0cfa0d><span class="text" data-v-6d0cfa0d><!----> technology <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="text-icon" data-v-6d0cfa0d><path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z"></path></svg></span></button><div class="menu" data-v-6d0cfa0d><div class="VPMenu" data-v-6d0cfa0d data-v-24d333ba><div class="items" data-v-24d333ba><!--[--><!--[--><div class="VPMenuLink" data-v-24d333ba data-v-78f06588><a class="VPLink link" href="/technology/待整理/" data-v-78f06588 data-v-a6710068><!--[-->待整理<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-24d333ba data-v-78f06588><a class="VPLink link" href="/technology/typescript/" data-v-78f06588 data-v-a6710068><!--[-->typescript<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-24d333ba data-v-78f06588><a class="VPLink link active" href="/technology/blog/" data-v-78f06588 data-v-a6710068><!--[-->博客搭建<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-24d333ba data-v-78f06588><a class="VPLink link" href="/technology/vantcli/" data-v-78f06588 data-v-a6710068><!--[-->vantcli文档<!--]--><!----></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/components/index.html" data-v-97cd7ece data-v-502d9526 data-v-a6710068><!--[-->组件库<!--]--><!----></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-52cf45e4 data-v-3c0f7ebf><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-label="toggle dark mode" aria-checked="false" data-v-3c0f7ebf data-v-1811cbb7 data-v-51cfdd54><span class="check" data-v-51cfdd54><span class="icon" data-v-51cfdd54><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-1811cbb7><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-1811cbb7><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div><!----><div class="VPFlyout VPNavBarExtra extra" data-v-52cf45e4 data-v-eaa5cb3f data-v-6d0cfa0d><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-6d0cfa0d><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-6d0cfa0d><circle cx="12" cy="12" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="5" cy="12" r="2"></circle></svg></button><div class="menu" data-v-6d0cfa0d><div class="VPMenu" data-v-6d0cfa0d data-v-24d333ba><!----><!--[--><!--[--><!----><div class="group" data-v-eaa5cb3f><div class="item appearance" data-v-eaa5cb3f><p class="label" data-v-eaa5cb3f>Appearance</p><div class="appearance-action" data-v-eaa5cb3f><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-label="toggle dark mode" aria-checked="false" data-v-eaa5cb3f data-v-1811cbb7 data-v-51cfdd54><span class="check" data-v-51cfdd54><span class="icon" data-v-51cfdd54><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-1811cbb7><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-1811cbb7><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div></div></div><!----><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-52cf45e4 data-v-f4211e0b><span class="container" data-v-f4211e0b><span class="top" data-v-f4211e0b></span><span class="middle" data-v-f4211e0b></span><span class="bottom" data-v-f4211e0b></span></span></button></div></div></div></div><!----></header><!----><!----><div class="VPContent" id="VPContent" data-v-236bb526 data-v-bb109c21><div class="VPDoc has-aside" data-v-bb109c21 data-v-9710e0b3><div class="container" data-v-9710e0b3><div class="aside" data-v-9710e0b3><div class="aside-curtain" data-v-9710e0b3></div><div class="aside-container" data-v-9710e0b3><div class="aside-content" data-v-9710e0b3><div class="VPDocAside" data-v-9710e0b3 data-v-b312be0a><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" data-v-b312be0a data-v-69920f5a><div class="content" data-v-69920f5a><div class="outline-marker" data-v-69920f5a></div><div class="outline-title" data-v-69920f5a>On this page</div><nav aria-labelledby="doc-outline-aria-label" data-v-69920f5a><span class="visually-hidden" id="doc-outline-aria-label" data-v-69920f5a> Table of Contents for current page </span><ul class="root" data-v-69920f5a data-v-5343b0c6><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-b312be0a></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-9710e0b3><div class="content-container" data-v-9710e0b3><!--[--><!--]--><main class="main" data-v-9710e0b3><div style="position:relative;" class="vp-doc _technology_blog_index" data-v-9710e0b3><div><h1 id="vitepress一键搭建github、gitee和个人网站博客" tabindex="-1">vitepress一键搭建github、gitee和个人网站博客 <a class="header-anchor" href="#vitepress一键搭建github、gitee和个人网站博客" aria-hidden="true">#</a></h1><blockquote><p>目前只记录最核心的内容，等发布的时候再次进行编辑</p></blockquote><blockquote><p>完成效果</p></blockquote><p>基于vite和vue搭建一个网站，其中包括vue的组件开发，组件可以显示在网站中。vitepress搭建md文档，文档支持md引入vue组件。项目的整体构造是</p><blockquote><p>现有架构模式</p></blockquote><p><img src="/assets/image-20230226005323562.0adba544.png" alt="image-20230226005323562"></p><p>上面设置的仓库，和下面的进行对应的配置，记住名字</p><h2 id="github仓库" tabindex="-1">github仓库 <a class="header-anchor" href="#github仓库" aria-hidden="true">#</a></h2><p>1、设置对应的环境变量</p><p><img src="/assets/image-20230225220741692.15b97763.png" alt="image-20230225220741692"></p><p>2、添加workfown，让其自动打包</p><div class="language-yml"><button title="Copy Code" class="copy"></button><span class="lang">yml</span><pre class="shiki material-theme-palenight" tabindex="0"><code><span class="line"><span style="color:#F07178;">name</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">pushDocs</span></span>
<span class="line"><span style="color:#FF9CAC;">on</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#F07178;">push</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#F07178;">branches</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span></span>
<span class="line"><span style="color:#BABED8;">     </span><span style="color:#89DDFF;">-</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">master</span></span>
<span class="line"><span style="color:#F07178;">jobs</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">   </span><span style="color:#F07178;">build-and-deploy</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#F07178;">runs-on</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">ubuntu-latest</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#F07178;">strategy</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#F07178;">matrix</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">node</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">lts/fermium</span><span style="color:#89DDFF;">&#39;</span><span style="color:#89DDFF;">]</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#F07178;">steps</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">-</span><span style="color:#BABED8;"> </span><span style="color:#F07178;">name</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">Checkout</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">uses</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">actions/checkout@main</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">with</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">          </span><span style="color:#F07178;">ref</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">master</span><span style="color:#89DDFF;">&#39;</span></span>
<span class="line"><span style="color:#BABED8;">          </span><span style="color:#F07178;">persist-credentials</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#FF9CAC;">false</span></span>
<span class="line"><span style="color:#BABED8;">          </span><span style="color:#F07178;">fetch-depth</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#F78C6C;">0</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">env</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">          </span><span style="color:#F07178;">TZ</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">Asia/Shanghai</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">-</span><span style="color:#BABED8;"> </span><span style="color:#F07178;">name</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">Use Node.js ${{ matrix.node-version }}</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">uses</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">actions/setup-node@main</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">with</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">          </span><span style="color:#F07178;">node-version</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;">  </span><span style="color:#C3E88D;">${{ matrix.node }}</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">-</span><span style="color:#BABED8;"> </span><span style="color:#F07178;">name</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">Install pnpm</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">run</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">npm install pnpm -g</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">-</span><span style="color:#BABED8;"> </span><span style="color:#F07178;">name</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">Install dependencies</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">run</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">pnpm install</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">-</span><span style="color:#BABED8;"> </span><span style="color:#F07178;">name</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">Build VitePress</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">run</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">pnpm run docs:build</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">-</span><span style="color:#BABED8;"> </span><span style="color:#F07178;">name</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">Deploy to Pages</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">env</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">         </span><span style="color:#F07178;">TZ</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">Asia/Shanghai</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#F07178;">run</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;font-style:italic;">|</span></span>
<span class="line"><span style="color:#C3E88D;">          cd docs/.vitepress/dist</span></span>
<span class="line"><span style="color:#C3E88D;">          git init</span></span>
<span class="line"><span style="color:#C3E88D;">          git config user.name &quot;Aresnine&quot;</span></span>
<span class="line"><span style="color:#C3E88D;">          git config user.email &quot;763555000@qq.com&quot;</span></span>
<span class="line"><span style="color:#C3E88D;">          git add .</span></span>
<span class="line"><span style="color:#C3E88D;">          git commit -m &#39;Deploying to gh-pages from @ $GITHUB_SHA in $(date +&quot;%Y年%m月%d日 %T %Z&quot;)&#39;</span></span>
<span class="line"><span style="color:#C3E88D;">         </span></span>
<span class="line"><span style="color:#C3E88D;">          git push -f https://Aresnine:${{secrets.ACCESS_TOKEN }}@github.com/Aresnine/Aresnine.github.io.git master:master</span></span>
<span class="line"><span style="color:#C3E88D;">          git push -f https://Aresnine:${{secrets.GITEE_ACCESS_TOKEN }}@gitee.com/Aresnine/blogdist.git master:master</span></span>
<span class="line"><span style="color:#C3E88D;">          cd -</span></span>
<span class="line"></span></code></pre></div><h2 id="个人网站" tabindex="-1">个人网站 <a class="header-anchor" href="#个人网站" aria-hidden="true">#</a></h2><p>基于gitee的action和宝塔的webhook，速度很快</p><p>参考文章：</p><ul><li><a href="https://www.likecs.com/show-204667970.html#sc=400" target="_blank" rel="noreferrer">https://www.likecs.com/show-204667970.html#sc=400</a></li><li><a href="https://blog.csdn.net/alipea/article/details/83858177" target="_blank" rel="noreferrer">https://blog.csdn.net/alipea/article/details/83858177</a></li></ul><blockquote><p>之前拉取gitee的webhook</p></blockquote><div class="language-bash"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight" tabindex="0"><code><span class="line"><span style="color:#676E95;font-style:italic;">#!/bin/bash</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;&quot;</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 输出当前时间</span></span>
<span class="line"><span style="color:#FFCB6B;">date</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">--date=</span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">0 days ago</span><span style="color:#89DDFF;">&#39;</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">+%Y-%m-%d %H:%M:%S</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">Start</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 判断宝塔WebHook参数是否存在</span></span>
<span class="line"><span style="color:#89DDFF;font-style:italic;">if</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">[</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">!</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">-n</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#BABED8;font-style:italic;">$1</span><span style="color:#89DDFF;">&quot;</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">];</span></span>
<span class="line"><span style="color:#89DDFF;font-style:italic;">then</span><span style="color:#BABED8;"> </span></span>
<span class="line"><span style="color:#BABED8;">          </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">param参数错误</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">          </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">End</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">          </span><span style="color:#82AAFF;">exit</span></span>
<span class="line"><span style="color:#89DDFF;font-style:italic;">fi</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># git项目路径</span></span>
<span class="line"><span style="color:#BABED8;">gitPath</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">/www/wwwroot/</span><span style="color:#BABED8;font-style:italic;">$1</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># git 网址</span></span>
<span class="line"><span style="color:#BABED8;">gitHttp</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">git@gitee.com:Aresnine/blogdist.git</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">Web站点路径：</span><span style="color:#BABED8;">$gitPath</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#676E95;font-style:italic;">#判断项目路径是否存在</span></span>
<span class="line"><span style="color:#89DDFF;font-style:italic;">if</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">[</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">-d</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#BABED8;">$gitPath</span><span style="color:#89DDFF;">&quot;</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">];</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;font-style:italic;">then</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">cd</span><span style="color:#BABED8;"> $gitPath</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#676E95;font-style:italic;">#判断是否存在git目录</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#89DDFF;font-style:italic;">if</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">[</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">!</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">-d</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">.git</span><span style="color:#89DDFF;">&quot;</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">];</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;font-style:italic;">then</span></span>
<span class="line"><span style="color:#BABED8;">                </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">在该目录下克隆 git</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">                </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">git</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">clone</span><span style="color:#BABED8;"> $gitHttp </span><span style="color:#C3E88D;">gittemp</span></span>
<span class="line"><span style="color:#BABED8;">                </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">mv</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">gittemp/.git</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">.</span></span>
<span class="line"><span style="color:#BABED8;">                </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">rm</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-rf</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">gittemp</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#89DDFF;font-style:italic;">fi</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">拉取最新的项目文件</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">javascript:</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">git</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">reset</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">--hard</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">origin/master</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">git</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">pull</span><span style="color:#BABED8;">       </span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">拉取结束End</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">exit</span></span>
<span class="line"><span style="color:#89DDFF;font-style:italic;">else</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">该项目路径不存在</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">新建项目目录</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#FFCB6B;">mkdir</span><span style="color:#BABED8;"> $gitPath</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">cd</span><span style="color:#BABED8;"> $gitPath</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#676E95;font-style:italic;">#判断是否存在git目录</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#89DDFF;font-style:italic;">if</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">[</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">!</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">-d</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">.git</span><span style="color:#89DDFF;">&quot;</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">];</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;font-style:italic;">then</span></span>
<span class="line"><span style="color:#BABED8;">                </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">在该目录下克隆 git</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">                </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">git</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">clone</span><span style="color:#BABED8;"> $gitHttp </span><span style="color:#C3E88D;">gittemp</span></span>
<span class="line"><span style="color:#BABED8;">                </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">mv</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">gittemp/.git</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">.</span></span>
<span class="line"><span style="color:#BABED8;">                </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">rm</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-rf</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">gittemp</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#89DDFF;font-style:italic;">fi</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">拉取最新的项目文件</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">         </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">git</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">reset</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">--hard</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">origin/master</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">git</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">pull</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">设置目录权限</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#FFCB6B;">sudo</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">chown</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-R</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">www:www</span><span style="color:#BABED8;"> $gitPath</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">echo</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">End</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#82AAFF;">exit</span></span>
<span class="line"><span style="color:#89DDFF;font-style:italic;">fi</span></span>
<span class="line"></span></code></pre></div></div></div></main><!--[--><!--]--><!----><!--[--><!--]--></div></div></div></div></div><!----><!--[--><!--]--></div></div>
    <script>__VP_HASH_MAP__ = JSON.parse("{\"components_button_index.md\":\"aa43389d\",\"面试题_js_index.md\":\"d9022b75\",\"technology_待整理_index.md\":\"cd182cba\",\"introduce.md\":\"151f998f\",\"technology_blog_index.md\":\"b9d66824\",\"technology_typescript_index.md\":\"b32f8f74\",\"www_index.md\":\"ee942a14\",\"面试题_index.md\":\"69aa1706\",\"面试题_html_index.md\":\"01fab77b\",\"技术总结_unocss.md\":\"185c54f2\",\"每日任务_index.md\":\"8d6f93c4\",\"components_index.md\":\"c76bb41d\",\"面试题_vue_index.md\":\"172437ce\",\"面试题_待整理_index.md\":\"b7b5073a\",\"index.md\":\"2bfd6ad8\",\"技术总结_index.md\":\"3f8dbe79\",\"technology_vantcli_index.md\":\"e26eafd5\",\"vue3_index.md\":\"bfa452eb\",\"vitepress_index.md\":\"8e83926c\"}")</script>
    <script type="module" async src="/assets/app.db42a1fc.js"></script>
    
  </body>
</html>